1. Area of the Invention
This invention relates to a program executing device which can execute programs using a processor, a program memory and a storage memory, and a method for executing programs by the device.
2. Description of the Prior Art
There is known a program executing device which execute programs using a processor, a program memory and a storage memory. This program executing device is called as a microcomputer, and it is mounted on various electrical or electronic apparatuses such as personal computers, optical disc drives, mobile phones, game apparatuses, televisions, microwave ovens, air conditioners and the like.
The program executing device is used for controlling various component devices (peripheral devices) constituting the electrical or electronic apparatus. For example, when such a program executing device is used in an optical disc drive, it is used for supplying input data to be inputted into a laser diode or an actuator or for analyzing output data outputted from switches and sensors and the like.
In such program executing devices, when a bug is found in the program or when the function of the electrical or electronic apparatus is to be upgraded, a previous program stored in a program memory thereof is overwritten with a new program, thereby debugging the bug or upgrading the function.
In such a program memory, another program (second program) for emergency use is normally stored in addition to the previous program to be rewritten (first program). The second program is used when the previous program (first program) is not properly overwritten with a new program so that the first program can not be executed properly. In such a case, the second program can operate the electrical or electronic apparatus instead of the first program.
However, if the first and seconds program are produce using the same source program, write and read of data used for executing the first and second programs must be carried out in separate memory areas in a storage memory.
Therefore, the storage capacity of the storage memory is necessarily increased, thus resulting in increased cost of the electrical or electronic apparatus equipped with the program executing device. Further, this also increases size of the electrical or electronic apparatus, thus leading to increased weight of the apparatus.